﻿'*******************************************************************************************
'* Copyright Brügmann Software GmbH, Papenburg
'* Author: Björn Kremer
'* Contact: codeplex<at>patorg.de
'* 
'* VB.CMIS is a VB.NET implementation of the Content Management Interoperability Services (CMIS) standard
'*
'* This file is part of VB.CMIS.
'* 
'* VB.CMIS is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License as published by
'* the Free Software Foundation, either version 3 of the License, or
'* (at your option) any later version.
'* 
'* VB.CMIS is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'* GNU Lesser General Public License for more details.
'* 
'* You should have received a copy of the GNU Lesser General Public License
'* along with VB.CMIS. If not, see <http://www.gnu.org/licenses/>.
'*******************************************************************************************
Imports CMISObjectModel
Imports CMISObjectModel.Properties

Public Class PropertyHelper



#Region "Properties"
   Public Shared Function CreateCmisPropertyLastModificationDate(value As DateTimeOffset()) As CmisPropertyDateTime
      Return New CmisPropertyDateTime() With { _
       .DisplayName = "Last Modification Date", _
       .LocalName = "LastModificationDate", _
       .PropertyDefinitionId = "cmis:lastModificationDate", _
       .QueryName = "cmis:lastModificationDate", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyCreationDate(value As DateTimeOffset()) As CmisPropertyDateTime
      Return New CmisPropertyDateTime() With { _
       .DisplayName = "Creation Date", _
       .LocalName = "CreationDate", _
       .PropertyDefinitionId = "cmis:creationDate", _
       .QueryName = "cmis:creationDate", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateIsVersionSeriesCheckedOut(value As Boolean) As ICMISProperty
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "Is VersionSeries Checked Out", _
       .LocalName = "IsVersionSeriesCheckedOut", _
       .PropertyDefinitionId = "cmis:isVersionSeriesCheckedOut", _
       .QueryName = "cmis:isVersionSeriesCheckedOut", _
       .Values = New Boolean() {value} _
      }
   End Function

   Public Shared Function CreateCmisPropertyCreatedBy(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Created By", _
       .LocalName = "CreatedBy", _
       .PropertyDefinitionId = "cmis:createdBy", _
       .QueryName = "cmis:createdBy", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyBaseTypeId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Base Type Id", _
       .LocalName = "BaseTypeId", _
       .PropertyDefinitionId = "cmis:baseTypeId", _
       .QueryName = "cmis:baseTypeId", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyContentStreamLength(value As Int64()) As CmisPropertyInteger
      Return New CmisPropertyInteger() With { _
       .DisplayName = "Content Stream Length", _
       .LocalName = "ContentStreamLength", _
       .PropertyDefinitionId = "cmis:contentStreamLength", _
       .QueryName = "cmis:contentStreamLength", _
       .Values = value _
      }
   End Function
   Public Shared Function CreateCmisPropertyContentStreamMimeType(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Content Stream MIME Type", _
       .LocalName = "ContentStreamMimeType", _
       .PropertyDefinitionId = "cmis:contentStreamMimeType", _
       .QueryName = "cmis:contentStreamMimeType", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyChangeToken(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Changetoken", _
       .LocalName = "Changetoken", _
       .PropertyDefinitionId = "cmis:changeToken", _
       .QueryName = "cmis:changeToken", _
       .Values = value _
      }
   End Function
   Public Shared Function CreateCmisPropertyParentId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Parent Id", _
       .LocalName = "ParentId", _
       .PropertyDefinitionId = "cmis:parentId", _
       .QueryName = "cmis:parentId", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyAllowedChildObjectTypeIds(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Allowed Child Object Type Ids", _
       .LocalName = "AllowedChildObjectTypeIds", _
       .PropertyDefinitionId = "cmis:allowedChildObjectTypeIds", _
       .QueryName = "cmis:allowedChildObjectTypeIds", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyObjectTypeId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Object Type Id", _
       .LocalName = "ObjectTypeId", _
       .PropertyDefinitionId = "cmis:objectTypeId", _
       .QueryName = "cmis:objectTypeId", _
       .Values = value _
      }
   End Function
   Public Shared Function CreateCmisPropertySecondaryObjectTypeIds(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Ids of the object’s secondary types.", _
       .LocalName = "secondaryObjectTypeIds", _
       .PropertyDefinitionId = "cmis:secondaryObjectTypeIds", _
       .QueryName = "cmis:secondaryObjectTypeIds", _
       .Values = value _
      }
   End Function




   Public Shared Function CreateCmisPropertyDocumentObjectTypeId() As ICMISProperty
      Return New CmisPropertyId() With { _
       .DisplayName = "CMIS Document", _
       .LocalName = "CmisDocument", _
       .PropertyDefinitionId = "cmis:objectTypeId", _
       .QueryName = "cmis:objectTypeId", _
       .Values = New String() {"cmis:document"} _
      }
   End Function


   Public Shared Function CreateCmisPropertyFolderObjectTypeId() As ICMISProperty
      Return New CmisPropertyId() With { _
       .DisplayName = "CMIS Folder", _
       .LocalName = "CmisFolder", _
       .PropertyDefinitionId = "cmis:objectTypeId", _
       .QueryName = "cmis:objectTypeId", _
       .Values = New String() {"cmis:folder"} _
      }
   End Function


   Public Shared Function CreateCmisPropertyPolicyObjectTypeId() As ICMISProperty
      Return New CmisPropertyId() With { _
       .DisplayName = "CMIS Policy", _
       .LocalName = "CmisPolicy", _
       .PropertyDefinitionId = "cmis:objectTypeId", _
       .QueryName = "cmis:objectTypeId", _
       .Values = New String() {"cmis:policy"} _
      }
   End Function


   Public Shared Function CreateCmisPropertyLastModifiedBy(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Last Modified By", _
       .LocalName = "LastModifiedBy", _
       .PropertyDefinitionId = "cmis:lastModifiedBy", _
       .QueryName = "cmis:lastModifiedBy", _
       .Values = value _
      }
   End Function

   '
   Public Shared Function CreateCmisPropertyPath(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Path", _
       .LocalName = "Path", _
       .PropertyDefinitionId = "cmis:path", _
       .QueryName = "cmis:path", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyVersionLabel() As ICMISProperty
      Return New CmisPropertyString() With { _
       .DisplayName = "Version Label", _
       .LocalName = "VersionLabel", _
       .PropertyDefinitionId = "cmis:versionLabel", _
       .QueryName = "cmis:versionLabel", _
       .Values = Nothing _
      }
   End Function


   Public Shared Function CreateCmisPropertyName(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Name", _
       .LocalName = "Name", _
       .PropertyDefinitionId = "cmis:name", _
       .QueryName = "cmis:name", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyDescription(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Description", _
       .LocalName = "Description", _
       .PropertyDefinitionId = "cmis:description", _
       .QueryName = "cmis:description", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyObjectId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "Object Id", _
       .LocalName = "ObjectId", _
       .PropertyDefinitionId = "cmis:objectId", _
       .QueryName = "cmis:objectId", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyCheckinComment(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "cmis:checkinComment", _
       .LocalName = "cmis:checkinComment", _
       .PropertyDefinitionId = "cmis:checkinComment", _
       .QueryName = "cmis:checkinComment", _
       .Values = value _
      }
   End Function



   Public Shared Function CreateCmisPropertyContentStreamFileName(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "cmis:contentStreamFileName", _
       .LocalName = "cmis:contentStreamFileName", _
       .PropertyDefinitionId = "cmis:contentStreamFileName", _
       .QueryName = "cmis:contentStreamFileName", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyContentStreamId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "cmis:contentStreamId", _
       .LocalName = "cmis:contentStreamId", _
       .PropertyDefinitionId = "cmis:contentStreamId", _
       .QueryName = "cmis:contentStreamId", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyIsImmutable(value As Boolean()) As CmisPropertyBoolean
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "cmis:isImmutable", _
       .LocalName = "cmis:isImmutable", _
       .PropertyDefinitionId = "cmis:isImmutable", _
       .QueryName = "cmis:isImmutable", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyIsLatestMajorVersion(value As Boolean()) As CmisPropertyBoolean
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "cmis:isLatestMajorVersion", _
       .LocalName = "cmis:isLatestMajorVersion", _
       .PropertyDefinitionId = "cmis:isLatestMajorVersion", _
       .QueryName = "cmis:isLatestMajorVersion", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyIsLatestVersion(value As Boolean()) As CmisPropertyBoolean
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "cmis:isLatestVersion", _
       .LocalName = "cmis:isLatestVersion", _
       .PropertyDefinitionId = "cmis:isLatestVersion", _
       .QueryName = "cmis:isLatestVersion", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyIsMajorVersion(value As Boolean()) As CmisPropertyBoolean
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "cmis:isMajorVersion", _
       .LocalName = "cmis:isMajorVersion", _
       .PropertyDefinitionId = "cmis:isMajorVersion", _
       .QueryName = "cmis:isMajorVersion", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyIsVersionSeriesCheckedOut(value As Boolean()) As CmisPropertyBoolean
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "cmis:isVersionSeriesCheckedOut", _
       .LocalName = "cmis:isVersionSeriesCheckedOut", _
       .PropertyDefinitionId = "cmis:isVersionSeriesCheckedOut", _
       .QueryName = "cmis:isVersionSeriesCheckedOut", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyVersionLabel(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "cmis:versionLabel", _
       .LocalName = "cmis:versionLabel", _
       .PropertyDefinitionId = "cmis:versionLabel", _
       .QueryName = "cmis:versionLabel", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyVersionSeriesCheckedOutBy(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "cmis:versionSeriesCheckedOutBy", _
       .LocalName = "cmis:versionSeriesCheckedOutBy", _
       .PropertyDefinitionId = "cmis:versionSeriesCheckedOutBy", _
       .QueryName = "cmis:versionSeriesCheckedOutBy", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyVersionSeriesCheckedOutId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "cmis:versionSeriesCheckedOutId", _
       .LocalName = "cmis:versionSeriesCheckedOutId", _
       .PropertyDefinitionId = "cmis:versionSeriesCheckedOutId", _
       .QueryName = "cmis:versionSeriesCheckedOutId", _
       .Values = value _
      }
   End Function


   Public Shared Function CreateCmisPropertyVersionSeriesId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "cmis:versionSeriesId", _
       .LocalName = "cmis:versionSeriesId", _
       .PropertyDefinitionId = "cmis:versionSeriesId", _
       .QueryName = "cmis:versionSeriesId", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyValue1(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Value1", _
       .LocalName = "Value1", _
       .PropertyDefinitionId = "Value1", _
       .QueryName = "Value1", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyValue2(value As String()) As CmisPropertyString
      Return New CmisPropertyString() With { _
       .DisplayName = "Value2", _
       .LocalName = "Value2", _
       .PropertyDefinitionId = "Value2", _
       .QueryName = "Value2", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyValue3(value As Decimal()) As CmisPropertyDecimal
      Return New CmisPropertyDecimal() With { _
       .DisplayName = "Value3", _
       .LocalName = "Value3", _
       .PropertyDefinitionId = "Value3", _
       .QueryName = "Value3", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertySourceId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "SourceId", _
       .LocalName = "cmis:sourceId", _
       .PropertyDefinitionId = "cmis:sourceId", _
       .QueryName = "cmis:sourceId", _
       .Values = value _
      }
   End Function

   Public Shared Function CreateCmisPropertyTargetId(value As String()) As CmisPropertyId
      Return New CmisPropertyId() With { _
       .DisplayName = "cmis:targetId", _
       .LocalName = "cmis:targetId", _
       .PropertyDefinitionId = "cmis:targetId", _
       .QueryName = "cmis:targetId", _
       .Values = value
      }
   End Function

   Public Shared Function CreateCmisPropertyIsPrivateWorkingCopy(value As Boolean()) As CmisPropertyBoolean
      Return New CmisPropertyBoolean() With { _
       .DisplayName = "cmis:isPrivateWorkingCopy", _
       .LocalName = "cmis:isPrivateWorkingCopy", _
       .PropertyDefinitionId = "cmis:isPrivateWorkingCopy", _
       .QueryName = "cmis:isPrivateWorkingCopy", _
       .Values = value
      }
   End Function
#End Region
End Class
